<?php
class WebAdmin extends CWebUser{
    public function getModel()
    {
        return Yii::app()->getSession()->get('current_admin');
    }

    public function login($identity, $duration = 0)
    {
        parent::login($identity, $duration);
        Yii::app()->getSession()->add('current_admin', $identity->getModel());
    }

    public function logout($destroySession = true)
    {
        // I always remove the session variable model.
        Yii::app()->getSession()->remove('current_admin');

        parent::logout($destroySession);
    }
}